Solution to Exercise 4

Solution to exercise 4.

We'll cover the following

Solution#

Again, the solution will work without the SECOND_HIGHEST alias.

Explanation#

The nested query in line 3 will retrieve the highest salary from the table. Then the outer query will retrieve the second highest salary as the WHERE clause will return the salary that is below the maximum salary.

The slides below will help to visualize the solution:

Created with Fabric.js 1.6.0-rc.1 The inner query will retrurn the record with the highest salary
1 of 2

And with this last exercise, our course comes to an end. Before we part ways, let’s look at where we should go from here.

Exercise 4
Final Remarks
Mark as Completed
Report an Issue